<!DOCTYPE html>
<html lang="zh-CN">

    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="/static/css/common.css">
        <link rel="stylesheet" href="/static/css/search.css">
        <link rel="stylesheet" href="/static/lib/layui/css/layui.css">
        <link rel="shortcut icon" href="/static/favicon.ico" type="image/x-icon">
        <title>文章搜索</title>
    </head>

    <body>
        <!-- 移动端菜单栏 -->
        <div class="mobile-menu">
            <span class="mobile-menu-icon">
                <i class="layui-icon layui-icon-menu-fill"></i>
            </span>
            <div class="mobile-menu-content">
                <p>
                    <a href="/">首页</a>
                </p>
                <p>
                    <a href="/archive">归档</a>
                </p>
                <p>
                    <a href="/about">关于</a>
                </p>
                <p>
                    <a target="_blank" href="https://www.ghxi.com/">资源</a>
                </p>
            </div>
        </div>


        <div class="container">
            <!-- 左侧菜单栏 -->
            <div class="side-bar">
                <!-- logo -->
                <div class="logo-wrapper">
                    <img src="/static/img/logo.png" alt="听雨" onclick="window.location.href='/';" />
                    <h1>听雨</h1>
                </div>
                <!-- 联系方式 -->
                <div class="contact-wrapper">
                    <span class="contact-email">
                        <img src="/static/img/email.svg" alt="1186472484@qq.com" />
                    </span>
                    <span class="contact-gitee">
                        <img src="/static/img/gitee.svg" alt="https://gitee.com/yuguofu/"
                            href="https://gitee.com/yuguofu/" onclick="window.open(this.getAttribute('href'));" />
                    </span>
                </div>
                <!-- 导航链接 -->
                <div class="navlink">
                    <ul class="navlist">
                        <li>
                            <a href="/">首页</a>
                        </li>
                        <li>
                            <a href="/archive">归档</a>
                        </li>
                        <li>
                            <a href="/about">关于</a>
                        </li>
                        <li>
                            <a target="_blank" href="https://www.ghxi.com/">资源</a>
                        </li>
                    </ul>
                </div>
            </div>

            <!-- 搜索结果 -->
            <div class="sresult-wrapper">
                <blockquote class="layui-elem-quote">
                    <h2>
                        关键字
                        <span class="sresult-name">
                            <?=$keyword?>
                        </span>
                        的搜索结果
                    </h2>
                </blockquote>

                <div class="sresult-main">

                    <?php foreach($articles as $article): ?>
                    <div class="article-card">
                        <h2 class="article-title">
                            <a href="/article/<?=$article['id']?>">
                                <?=$article['title']?>
                            </a>
                        </h2>
                        <div class="article-des">
                            <p>
                                <?=$article['description']?>
                            </p>
                        </div>
                        <div class="article-info">
                            <span>作者：听雨</span>
                            <span class="info-cate">分类：
                                <?=$article['cate_name']?>
                            </span>
                            <span class="info-created">发布时间：
                                <?=$article['created_at']?>
                            </span>
                        </div>
                    </div>
                    <?php endforeach; ?>

                </div>
            </div>

        </div>

    </body>

</html>